package org.nvframe.component.state;

import org.newdawn.slick.geom.Vector2f;
import org.nvframe.component.AbstractComponent;
import org.nvframe.entity.Entity;
import org.nvframe.util.Settings;

/**
 * 
 * @author Nik Van Looy
 */
public class NormalPosition extends AbstractComponent implements Position {

	private Vector2f position;
	private float direction;

	private float scale;
	private float height;
	private float width;

	public NormalPosition(String id, Entity owner, Settings settings) {
		super(id, owner);

		position = new Vector2f(0, 0);
		
		scale = 1;
		direction = 0;
	}
	
	public Vector2f getXY() {
		return position.copy();
	}

	public void setXY(Vector2f position) {
		this.position = position.copy();
	}
	
	public void setXY(float x, float y) {
		setXY(new Vector2f(x, y));
	}

	public float getDirection() {
		return direction;
	}

	public void setDirection(float direction) {
		this.direction = direction;
	}
	
	public float getX() {
		return position.getX();
	}
	
	public float getY() {
		return position.getY();
	}
	
	public void setX(float x) {
		position = new Vector2f(x, getY());
	}
	
	public void setY(float y) {
		position = new Vector2f(getX(), y);
	}

	public float getScale() {
		return scale;
	}

	public void setScale(float scale) {
		this.scale = scale;
	}

	public float getHeight() {
		return height;
	}

	public void setHeight(float height) {
		this.height = height;
	}

	public float getWidth() {
		return width;
	}

	public void setWidth(float width) {
		this.width = width;
	}
	
}
